﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectEulerSolutions
{
    /*
     * 
     * We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.

What is the largest n-digit pandigital prime that exists?

     * 
     * */
    class Problem41 : IProblem
    {
        public string Calculate()
        {

            List<int> digits = new List<int>()
            {
                7,6,5,4,3,2,1
            };

            var q = CommonFunctions.GetPermutations(digits);

            foreach (int i in q)
            {
                if (CommonFunctions.IsPrime(i))
                    return i.ToString();
            }

            throw new NotImplementedException();
        }
    }
}
